#pragma once

#include "DAEFloat3.h"

/**
* This class defines a line segment, and is used 
* (among others) for intersection tests.
* @author Koen Samyn
*/
class LineSegment
{
public:
	/**
	* Defines  a line segment.
	* @param p1 the first point of the line segment.
	* @param p2 the second point of the line segment.
	*/
	LineSegment(DAEFloat3& p1, DAEFloat3& p2);
	/**
	* Deletes the line segment.
	*/
	~LineSegment(void);
	/**
	* Returns the start point.
	* @return the start point.
	*/
	DAEFloat3 GetP1(){
		return m_Point1;
	}

	/**
	* Returns the end point.
	* @return the end point.
	*/
	DAEFloat3 GetP2(){
		return m_Point2;
	}

	/**
	* Returns the (non normalized) vector from start point to end point.
	* @return the (non normalized) direction of this segment.
	*/
	DAEFloat3 GetD(){
		return m_Point2 - m_Point1;
	}

private:
	DAEFloat3 m_Point1;
	DAEFloat3 m_Point2;

	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	LineSegment(const LineSegment& t);
	LineSegment& operator=(const LineSegment& t);
};

